import { generateHighlightNodeForSalePrice } from '@/utils/bizUtils';

export const TABLE_COLUMNS = [
  {
    title: 'SKU编码',
    key: 'skuNo'
  },
  {
    title: '商品名称',
    key: 'productName'
  },
  {
    title: '规格',
    key: 'specialAttrStr'
  },
  {
    title: '计量单位',
    key: 'unitStr'
  },
  {
    title: '四级类编码',
    key: 'categoryNo'
  },
  {
    title: '四级类名称',
    key: 'categoryName'
  },
  {
    title: '品牌',
    key: 'brandName'
  },
  {
    title: '是否采购多计量',
    key: 'isPurchaseMultiUnitStr'
  },
  {
    title: '销售区域',
    children: [
      { title: '原值', key: 'saleAreaCodeOriginStr' },
      {
        title: '现值',
        render: (h, { row }) => <span>
          { generateHighlightNodeForSalePrice(h, row.saleAreaCodeOriginStr, row.saleAreaCodeNowStr) }
        </span>
      }
    ]
  },
  {
    title: '库存',
    key: 'stockAmount'
  },
  {
    title: '采购在途',
    key: 'purchaseAmount'
  },
  {
    title: '转货在途',
    key: 'transferAmount'
  },
  {
    title: '销售占用',
    key: 'occurAmount'
  }
]

export const ERROR_MSG_COL = {
  title: '禁止提交原因',
  key: 'errorMsg',
  fixed: 'left',
  width: '130',
  sortable: true,
  errorTip: true,
  notShowTip: true,
}

export const FOOTER_ITEMS = [
  { label: '单据号', prop: 'recordNo' },
  { label: '审核状态', prop: 'commitStateStr' },
  { label: '提交人', prop: 'pusherName' },
  { label: '提交时间', prop: 'pushTime' },
  { label: '提交部门', prop: 'pusherDeptName' },
  { label: '区域', prop: 'pusherAreaName' },
]
